package com.ruoyi.iot.service.impl;

import java.util.List;

import cn.hutool.core.util.IdUtil;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.iot.mapper.FacDevicesTypeClassMapper;
import com.ruoyi.iot.domain.FacDevicesTypeClass;
import com.ruoyi.iot.service.IFacDevicesTypeClassService;

/**
 * 设备类型Service业务层处理
 * 
 * @author rww
 * @date 2024-06-18
 */
@Service
public class FacDevicesTypeClassServiceImpl implements IFacDevicesTypeClassService 
{
    @Autowired
    private FacDevicesTypeClassMapper facDevicesTypeClassMapper;

    /**
     * 查询设备类型
     * 
     * @param id 设备类型主键
     * @return 设备类型
     */
    @Override
    public FacDevicesTypeClass selectFacDevicesTypeClassById(Long id)
    {
        return facDevicesTypeClassMapper.selectFacDevicesTypeClassById(id);
    }

    /**
     * 查询设备类型列表
     * 
     * @param facDevicesTypeClass 设备类型
     * @return 设备类型
     */
    @Override
    public List<FacDevicesTypeClass> selectFacDevicesTypeClassList(FacDevicesTypeClass facDevicesTypeClass)
    {
        return facDevicesTypeClassMapper.selectFacDevicesTypeClassList(facDevicesTypeClass);
    }

    /**
     * 新增设备类型
     * 
     * @param facDevicesTypeClass 设备类型
     * @return 结果
     */
    @Override
    public int insertFacDevicesTypeClass(FacDevicesTypeClass facDevicesTypeClass)
    {
        facDevicesTypeClass.setId(IdUtil.getSnowflakeNextId());
        facDevicesTypeClass.setCreateTime(DateUtils.getNowDate());
        return facDevicesTypeClassMapper.insertFacDevicesTypeClass(facDevicesTypeClass);
    }

    /**
     * 修改设备类型
     * 
     * @param facDevicesTypeClass 设备类型
     * @return 结果
     */
    @Override
    public int updateFacDevicesTypeClass(FacDevicesTypeClass facDevicesTypeClass)
    {
        return facDevicesTypeClassMapper.updateFacDevicesTypeClass(facDevicesTypeClass);
    }

    /**
     * 批量删除设备类型
     * 
     * @param ids 需要删除的设备类型主键
     * @return 结果
     */
    @Override
    public int deleteFacDevicesTypeClassByIds(Long[] ids)
    {
        return facDevicesTypeClassMapper.deleteFacDevicesTypeClassByIds(ids);
    }

    /**
     * 删除设备类型信息
     * 
     * @param id 设备类型主键
     * @return 结果
     */
    @Override
    public int deleteFacDevicesTypeClassById(Long id)
    {
        return facDevicesTypeClassMapper.deleteFacDevicesTypeClassById(id);
    }
}
